package org.aurora.core.biz.controller.api;

import org.aurora.core.biz.service.ITaskService;
import org.aurora.model.entity.Task;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/task")
public class TaskController {

    @Resource
    private ITaskService taskService;

    @PostMapping("/save")
    public HttpResponse<Long> saveTask(@RequestBody Task task) {
        return HttpResponse.buildSuccess(taskService.saveTask(task));
    }

    @PostMapping("/update")
    public void updateTask(@RequestBody Task task) {

    }

    @GetMapping("/query")
    public Task queryTask(@RequestParam Long id) {
        return taskService.queryTask(id);
    }

    @GetMapping("/delete")
    public void deleteTask(@RequestParam Long id) {

    }

}
